import requests


class AddEmp(object, ):
    def add_emp(self, emp_head, emp_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                             headers=emp_head, json=emp_data)
        return resp


if __name__ == '__main__':
    emp = AddEmp()
    emp_head = {"Content-Type": "application/json"
        , "Authorization": "624c7dd2-355d-4886-b6c7-66d12ab74e0b"}
    emp_data = {"username": "王贤", "mobile": "13654387491", "workNumber": "9527"}
    ret = emp.add_emp(emp_head, emp_data)
    print(ret.json())
